import request from "@/utils/request";

const RevampAPI = {
  /**
   * @description 改造分类选项
   */
  getRevampCategoryOptions() {
    return request<any, OptionType[]>({
      url: "/admin/user/projectSelectList",
      method: "post",
    });
  },

  /**
   * @description 用户添加改造项目
   */
  addRevamp(data: any) {
    return request<any, any>({
      url: "/admin/user/addUserProject",
      method: "post",
      data,
    });
  },

  /**
   * @description 编辑改造项目 项
   * @param data 改造项目项
   */
  editRevamp(data: any) {
    return request<any, any>({
      url: "/admin/user/editUserProject",
      method: "post",
      data,
    });
  },

  /**
   * @description 用户删除改造项目
   * @param id ID
   */
  deleteRevamp(id: any) {
    return request<any, any>({
      url: "/admin/user/delUserProject",
      method: "post",
      data: { id },
    });
  },

  /**
   * @description 请求改造项目详情
   * @param id ID
   */
  getDetail(id: any) {
    return request<any, any>({
      url: "/admin/user/userProjectDetail",
      method: "post",
      data: { id },
    });
  },

  /**
   * 获取改造花名册分页列表
   * @param data 请求参数
   */
  getPage(data: any) {
    return request<any, any>({
      url: "/admin/user/userProjectList",
      method: "post",
      data,
    });
  },
};

export default RevampAPI;
